﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MShop.Web.Components.Paging.PagedList<MShop.Core.Domain.Product>>" %>

 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="content" class="ovfl">
        <div id="left" class="side fl">
            <div class="s_box sb_1">
                <h2 class="colorFF0000">
                    一口价商品推荐</h2>
                <div class="sp_tj">
                    <%=Html.Action("RecommendProduct") %>                     
                </div>
            </div>
            <div id="left" class="side fl">
                <div class="s_box sb_1">
                    <h2 class="colorFF0000">
                        热卖商品</h2>
                    <div class="sp_tj">
                        <%=Html.Action("TopProduct")%>          
                    </div>
                </div>
            </div>
        </div>
        <div id="right" class="main fr">
            <div class="xuan ovfl">
                <ul>
                    <li class="lei">种类:</li>
                    <li>
                       <% if (Request.Params["cid"] != null && -1 == Convert.ToInt32(Request.Params["cid"]))
                          { %>
                        <%=Html.ActionLink("不限", "Index", new { cid = -1, minprice = Request.Params["minprice"], maxprice = Request.Params["maxprice"], region = Request.Params["region"] }, new { @class = "selected" })%>
                        <%}
                          else
                          { %>
                             <%=Html.ActionLink("不限", "Index", new { cid = -1, minprice = Request.Params["minprice"], maxprice = Request.Params["maxprice"], region = Request.Params["region"] })%>
                        <%} %>
                        <% IEnumerable<ItemCat> cats = ViewData["cids"] as IEnumerable<ItemCat>;
                           foreach (var item in cats)
                           {
                        %>
                        <% if (Request.Params["cid"] != null && item.Id==Convert.ToInt32(Request.Params["cid"])){ %>
                        <%=Html.ActionLink(item.Name,"Index",new{cid=item.Id,minprice=Request.Params["minprice"],maxprice=Request.Params["maxprice"],region=Request.Params["region"]}, new { @class = "selected" }) %>
                        <%}else{ %>
                          <%=Html.ActionLink(item.Name,"Index",new{cid=item.Id,minprice=Request.Params["minprice"],maxprice=Request.Params["maxprice"],region=Request.Params["region"]}) %>
                        <%}} %>
                    </li>
                </ul>
                <%=Html.Partial("pricecontrol") %>
                <ul>
                    <li class="lei">产地:</li>
                    <li>
                     <% if (Request.Params["region"] != null && -1 == Convert.ToInt32(Request.Params["region"]))
                        { %>
                        <%=Html.ActionLink("不限", "Index", new { cid = Request.Params["cid"], minprice = Request.Params["minprice"], maxprice = Request.Params["maxprice"], region = -1 }, new { @class = "selected" })%>
                       <%}
                        else
                        { %>
                          <%=Html.ActionLink("不限", "Index", new { cid = Request.Params["cid"], minprice = Request.Params["minprice"], maxprice = Request.Params["maxprice"], region = -1 })%>
                       <%} %>
                        <% IEnumerable<Dictionary> regions = ViewData["regions"] as IEnumerable<Dictionary>;
                           foreach (var item in regions)
                           {
                        %>
                         <% if (Request.Params["region"] != null && item.Value == Convert.ToInt32(Request.Params["region"]))
                            { %>
                        <%=Html.ActionLink(item.Key, "Index", new { cid = Request.Params["cid"], minprice = Request.Params["minprice"], maxprice = Request.Params["maxprice"], region = item.Value }, new { @class = "selected" })%>
                        <%}else{ %>
                          <%=Html.ActionLink(item.Key, "Index", new { cid = Request.Params["cid"], minprice = Request.Params["minprice"], maxprice = Request.Params["maxprice"], region = item.Value })%>
                        <%}} %>
                    </li>
                </ul>
            </div>
            <div id="prdList" class="ct_2 border">
                <h2>
                    产品列表</h2>
                <div class="ovfl">
                    <% foreach (var item in Model)
                       { %>
                    <table>
                        <tr>
                            <td  >
                                <a href='/product/item/<%=item.Id %>'>
                                    <img src='<%=item.ThumbImageUrl %>' /></a>
                            </td>
                            <td class="name">
                                <a href='/product/item/<%=item.Id %>'>
                                    <%=item.ProductName %></a><br />
                                <del>市场价：￥<%=item.Price%></del>
                                <i>商城价：￥<%=item.ShopPrice %></i>
                            </td>
                        </tr>
                    </table>
                    <% } %>
                </div>
                <div class="pageNav ovfl">
                    <%=Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount, new { cid = Request.Params["cid"],region=Request.Params["region"],minprice=Request.Params["minprice"],maxprice=Request.Params["maxprice"] })%>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
</asp:Content>
